import { httpBatchLink } from "@trpc/client";
import { appRouter } from "~/server/api/root";
import { createTRPCContext } from "~/server/api/trpc";
import { createServerSideHelpers } from "@trpc/react-query/server";
import superjson from "superjson";
import { getServerAuthSession } from "~/server/auth";

export async function createServerClient() {
  const session = await getServerAuthSession();
  
  return createServerSideHelpers({
    router: appRouter,
    ctx: await createTRPCContext({ session }),
    transformer: superjson,
  });
} 